package cn.itcast.www.junitTest;

import java.util.Enumeration;
import java.util.Iterator;
import java.util.Vector;

public class BadVisitor {
	
	public static void main(String[] args) {
		Vector v = new Vector();
		v.add("one");
		v.add("two");
		v.add("three");
		v.add("four");
		Enumeration enume = v.elements();
		while(enume.hasMoreElements()){
			String s = (String) enume.nextElement();
			if(s.equals("two")){
				v.remove("two");
			}else{
				System.out.println(s); //��ʾ���Ϊone,four
			}
		}
		System.out.println("what`s really there ...");
		Iterator iter = v.iterator();
		while(iter.hasNext()){
			String s = (String) iter.next();
			System.out.println(s); //��ʾ���Ϊone, three, four
		}
	}
}
